import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';

// 引入常量路由
import { constantRoutes } from './routes';

const router = createRouter({
  history: createWebHistory(),
  routes: constantRoutes as RouteRecordRaw[], // 明确指定路由数组类型
  // 路由切换时滚动行为
  scrollBehavior: () => {
    return {
      left: 0,
      top: 0,
    };
  },
});

export default router;



